package zf.data.crypto
{
	import flash.events.Event;
	import flash.utils.ByteArray;
	
	public class XXTEAAsynEvent extends Event
	{
		public static const ENCRYPT_COMPLETE:String="encrypt_complete";
		public static const DECRYPT_COMPLETE:String="decrypt_complete";
		public static const PROGRESS:String="progress";
		
		private var _data:ByteArray;
		private var _state:uint;
		private var _totalState:uint;
		private var _bytesLoaded:Number;
		private var _bytesTotal:Number
		public function XXTEAAsynEvent(type:String, byte:ByteArray=null,s:uint=0,ts:uint=0,bl:Number=0,bt:Number=0, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			_data=byte;
			_state=s;
			_totalState=ts;
			/*if(bl<0)
			{
				bt=bt-bl;
				bl=0;
			}*/
			_bytesLoaded=bl;
			_bytesTotal=bt;
			super(type, bubbles, cancelable);
		}

		public function get bytesTotal():Number
		{
			return _bytesTotal;
		}

		public function get bytesLoaded():Number
		{
			return _bytesLoaded;
		}

		public function get totalState():uint
		{
			return _totalState;
		}

		public function get state():uint
		{
			return _state;
		}

		public function get data():ByteArray
		{
			return _data;
		}

	}
}